﻿#region Disclaimer / License
// Copyright (C) 2011, Kenneth Bergeron, IAP Worldwide Services, Inc
// NOAA :: National Marine Fisheries Service
// 
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// 
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
// 
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CatchProcessing.Properties
{
    /// <summary>
    /// Some Settings routines
    /// </summary>
    internal sealed partial class Settings
    {
        /// <summary>
        /// Has the Main Window state been saved before?
        /// </summary>
        public bool IsMainWindowStateDefined
        {
            get { return this.MainWorkingArea != System.Drawing.Size.Empty; }
        }
        /// <summary>
        /// The main window form state
        /// </summary>
        public System.Windows.Forms.FormWindowState MainFormWindowState
        {
            get
            {
                if (!System.Enum.IsDefined(typeof(System.Windows.Forms.FormWindowState), this.MainWindowState))
                    return System.Windows.Forms.FormWindowState.Normal;
                return (System.Windows.Forms.FormWindowState)
                    System.Enum.Parse(typeof(System.Windows.Forms.FormWindowState), this.MainWindowState);
            }
            set { this.MainWindowState = value.ToString(); }
        }
        /// <summary>
        /// Has the catch window state been saved?
        /// </summary>
        public bool IsCatchDialogWindowStateDefined
        {
            get { return System.Enum.IsDefined(typeof(System.Windows.Forms.FormWindowState), this.CatchDialogWindowState); }
        }
        /// <summary>
        /// The catch dialog form state
        /// </summary>
        public System.Windows.Forms.FormWindowState CatchDialogFormWindowState
        {
            get
            {
                if (!IsCatchDialogWindowStateDefined)
                    return System.Windows.Forms.FormWindowState.Normal;
                return (System.Windows.Forms.FormWindowState)
                    System.Enum.Parse(typeof(System.Windows.Forms.FormWindowState), this.CatchDialogWindowState);
            }
            set { this.CatchDialogWindowState = value.ToString(); }
        }
        /// <summary>
        /// Expose the TaxonomyLevel as a type
        /// </summary>
        public Taxonomy.TaxonomyLevel Level
        {
            get
            {
                if (!System.Enum.IsDefined(typeof(Taxonomy.TaxonomyLevel), this.TaxLevelString)) return Taxonomy.TaxonomyLevel.Recent;
                return (Taxonomy.TaxonomyLevel)System.Enum.Parse(typeof(Taxonomy.TaxonomyLevel), this.TaxLevelString);
            }
            set { this.TaxLevelString = value.ToString(); }
        }
        /// <summary>
        /// Provide the current Vessel Name
        /// </summary>
        public string VesselName
        {
            get { return DataSets.Glob.Support.VesselName(this.VesselCode); }
        }
    }
}
